/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.game.math.view.render;

import java.awt.Component;
import javax.swing.DefaultCellEditor;
import javax.swing.JTable;
import javax.swing.JTextField;

/**
 *
 * @author nmduc
 */
class InputResultCellEditor( textField:JTextField) extends DefaultCellEditor(textField) {

  var setFont:Boolean = false;
  def this() = {
    this(new JTextField());
    this.setFont = false;
  }
  
  override def getTableCellEditorComponent(table:JTable, value:Any, isSelected:Boolean, row:Int, column:Int):Component = {
    val component:Component = super.getTableCellEditorComponent(table, value, isSelected, row, column);
    if (!setFont) {
      component.setFont(table.getFont());
      setFont = true;
    }
    component;
  }
}
